import { CHANNEL_SAVE_ID, CHANNEL_SAVE_LIST } from '../action/actionTypes';

const initialState = {
  list: [],
  currentId: 0,
};

export default function channelReducer(state = initialState, { type, payload }) {
  switch (type) {
    case CHANNEL_SAVE_LIST:
      return { ...state, list: payload };
    case CHANNEL_SAVE_ID:
      return { ...state, currentId: payload };
    default:
      return state;
  }
}
